package stream;

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * @Author: hmm
 * @Created: 2019/12/18
 * @Description: 新特性流的使用
 * 1、将数值、数组、集合转为stream
 * 数值类型目前有三种：IntStream、LongStream、DoubleStream
 * Stream stream = Stream.of("a", "b", "c");
 * - - Arrays
 * String [] strArray = new String[] {"a", "b", "c"};
 * stream = Stream.of(strArray);
 * stream = Arrays.stream(strArray);
 * - - Collections
 * List<String> list = Arrays.asList(strArray);
 * stream = list.stream();
 *
 *
 *
 * @Modified by:
 */
public class StreamUse {

    public static void main(String[] args) {
        List<String> collect = Stream.of(new String[]{"a", "b", "c"}).map(String::toUpperCase).collect(Collectors.toList());
        collect.stream().forEach(System.out::println);
    }
}
